home *** CD-ROM | disk | FTP | other *** search
/ Champak 145 / (Vol 145) Dec 21 2011.iso / Games / kupidon-strike.swf / scripts / frame_210 / PlaceObject2_253_558 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2011-12-21  |  1.7 KB  |  51 lines

  1. onClipEvent(enterFrame){
  2.    if(this.active)
  3.    {
  4.       if(move_delay >= 0)
  5.       {
  6.          move_delay--;
  7.       }
  8.       if(this.moveble && move_delay < 0)
  9.       {
  10.          if(c_path <= 0)
  11.          {
  12.             move_direction = -1;
  13.          }
  14.          if(c_path >= move_path)
  15.          {
  16.             move_direction = 1;
  17.          }
  18.          if(move_direction == 1)
  19.          {
  20.             c_path -= move_speed;
  21.             _X = _X + move_speed * Math.sin(move_angle * 0.017453292519943295);
  22.             _Y = _Y - move_speed * Math.cos(move_angle * 0.017453292519943295);
  23.          }
  24.          if(move_direction == -1)
  25.          {
  26.             c_path += move_speed;
  27.             _X = _X - move_speed * Math.sin(move_angle * 0.017453292519943295);
  28.             _Y = _Y + move_speed * Math.cos(move_angle * 0.017453292519943295);
  29.          }
  30.       }
  31.       if(this.hitTest(_root.bullet._x,_root.bullet._y,true) or this.hitTest(_root.bullet._x - 10 * Math.sin(_root.bullet._rotation * 0.017453292519943295),_root.bullet._y + 10 * Math.cos(_root.bullet._rotation * 0.017453292519943295),true) or this.hitTest(_root.bullet._x - 20 * Math.sin(_root.bullet._rotation * 0.017453292519943295),_root.bullet._y + 20 * Math.cos(_root.bullet._rotation * 0.017453292519943295),true))
  32.       {
  33.          if(!_root.stoned)
  34.          {
  35.             _root.do_sound("sHeart",true);
  36.             rem();
  37.          }
  38.       }
  39.       i = 0;
  40.       while(i < _root.tohit.length)
  41.       {
  42.          if(this.active && this.hitTest(_root[_root.tohit[i]]._x,_root[_root.tohit[i]]._y,true))
  43.          {
  44.             _root.do_sound("sHeart",true);
  45.             rem();
  46.          }
  47.          i++;
  48.       }
  49.    }
  50. }
  51.